package com.enjoy.book.biz;

import com.enjoy.book.bean.User;
import com.enjoy.book.dao.UserDao;

import java.sql.SQLException;

public class UserBiz {

    // 构建UserDao的对象
    UserDao userDao = new UserDao();

    // 登录功能
    public User getUser(String name, String pwd){

        //传递
        User user = null;
        try {
            user = userDao.getUser(name,pwd);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return user;
    }

    // 构建建修改密码biz对象
    public int modifyPwd(long id,String pwd){
        int count = 0;
        try {
        // 通过UserDao调用modify
            count = userDao.modifyPwd(id,pwd);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return count;
    }
}
